package com.mrjy.maintain.bo;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.mrjy.common.entity.TeacherInfoTypeRel;
import com.mrjy.maintain.dao.ITeacherInfoTypeRelDao;

@Service("teacherInfoTypeRelBo")
public class TeacherInfoTypeRelBo implements ITeacherInfoTypeRelBo{

	@Resource
	private ITeacherInfoTypeRelDao teacherInfoTypeRelDao;

	@Override
	public int txInsert(TeacherInfoTypeRel rel) {
		return teacherInfoTypeRelDao.insert(rel);
	}

	@Override
	public int txDeleteByIds(int[] ids) {
		return teacherInfoTypeRelDao.deleteByIds(ids);
	}

	@Override
	public int txUpdateById(TeacherInfoTypeRel rel) {
		return teacherInfoTypeRelDao.updateById(rel);
	}

	@Override
	public TeacherInfoTypeRel queryById(int id) {
		return teacherInfoTypeRelDao.queryById(id);
	}

	@Override
	public Object selectListByTeacherId(Integer teacherId) {
		Map<String, Object> map = new HashMap<String, Object>();
		List<TeacherInfoTypeRel> list = teacherInfoTypeRelDao.selectListByTeacherId(teacherId);
		if (null != list && list.size() > 0) {
			map.put("err_code", 0);
			map.put("err_msg", "查询成功");
			map.put("teacherList", list);
		}else {
			map.put("err_code", 1);
			map.put("err_msg", "无数据");
		}
		return map ;
	}
	
	
}
